//
//  HYXUnitTestBaseViewModel.m
//  SpeSmartUnitTester_Example
//
//  Created by points on 2020/8/16.
//  Copyright © 2020 hfqf123. All rights reserved.
//

#import "HYXUnitTestBaseViewModel.h"

@implementation HYXUnitTestBaseViewModel


- (void)dealloc
{
    NSLog(@"dealloc--->%@",NSStringFromClass([self class]));
}

- (id)initWith:(HYXUnitTestBaseViewController *)vc delegate:(id<HYXUnitTestBaseViewModelProtocol>)delegate{
    if(self = [super init]){
        self.controller = vc;
        self.vmDelegate = delegate;
//        if(!self.vmDelegate){
//            [self onStartExcuteBussnessLogic];
//        }else{
//            [self.vmDelegate onStartExcuteBussnessLogic];
//        }
        
//        if(!self.vmDelegate){
//            [self onGetMockData];
//        }else{
//            [self.vmDelegate onGetMockData];
//        }
    }
    return self;
}


- (id)initWith:(HYXUnitTestBaseViewController *)vc{
    if(self = [super init]){
        self.controller = vc;
//        [self onGetMockData];
//        [self onStartExcuteBussnessLogic];
    }
    return self;
}

- (void)onUnitTestCommitedBlock{
#if NEED_UNITTEST
    if(self.controller.onUnitTestCommitedBlock){
        HYXUnitTestNode *next = [HYXUnitTestNode getNextNode:self.controller.unitTestNode];
        self.controller.onUnitTestCommitedBlock(self.controller.unitTestNode,self.controller);
    }
#endif
}

@end
